# -*- coding:utf-8 -*-
# @FileName :config.py
# @Date: 2024/7/29
# @Author:天空之城
import os

from address_normalizer.app.logger import Logger

TOKENIZE_MODEL = 'jieba'  # jieba or rule
DEFAULT_FREQUENCY = 100
# 比对相似度
CUTOFF = 0.8
# 项目绝对路径
PROJECT_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
CONFIG_LOGGING_LOG_PATH = os.path.join(os.getcwd(), 'logs')
CONFIG_LOGGING_LOG_FILENAME = "address_normalizer.log"
CONFIG_LOGGING_LOG_ENCODING = "utf-8"

# HTTP_HOST = '0.0.0.0'
HTTP_HOST = 'localhost'  # 或者 '127.0.0.1'
HTTP_PORT = 5118

logger = Logger(CONFIG_LOGGING_LOG_PATH, CONFIG_LOGGING_LOG_FILENAME, CONFIG_LOGGING_LOG_ENCODING)
PROJECT_DATA_PATH = os.path.join(PROJECT_PATH, 'data')
PATTERN_FILE = os.path.join(PROJECT_DATA_PATH, 'address_patterns.txt')
JIEBA_FILE = os.path.join(PROJECT_DATA_PATH, 'jieba_patterns.txt')
CHINA_REGIONS_JSON = os.path.join(PROJECT_DATA_PATH, 'china_regions.json')
# 行内数据地址
EXCEL_FILE = os.path.join(PROJECT_DATA_PATH, 'address_code.xlsx')
PROVINCE_CITY_DISTRICT = os.path.join(PROJECT_DATA_PATH, 'province_city_district.csv')
